# 编译器设置
CXX = g++
CXXFLAGS = -std=c++11 -Wall -Wextra -pthread

# 目标文件
TARGETS = test test1 test2

# 默认构建所有目标
all: $(TARGETS)

# 编译 Testpthread.cpp -> test
test: Testpthread.cpp
	$(CXX) $(CXXFLAGS) $< -o $@

# 编译 PthreadPool.cpp -> test1
test1: PthreadPool.cpp
	$(CXX) $(CXXFLAGS) $< -o $@

# 编译 PthreadPool1.cpp -> test2
test2: PthreadPool1.cpp
	$(CXX) $(CXXFLAGS) $< -o $@

# 清理生成的可执行文件
clean:
	rm -f $(TARGETS)

# 声明伪目标
.PHONY: all clean